#pragma once

#include <QGraphicsView>
#include <QWheelEvent>
#include <QMouseEvent>
#include <QResizeEvent>
#include <QVector>

class MyGraphicsView : public QGraphicsView
{
    Q_OBJECT

public:
    MyGraphicsView(QWidget *parent = nullptr);

    void wheelEvent(QWheelEvent *event) override;
    void resizeEvent(QResizeEvent *event) override;
    void contextMenuEvent(QContextMenuEvent *event) override;

    void CalculateViewportScale(QWheelEvent *event);

    void fitInView();

Q_SIGNALS:

    void setPreviewRect(QRect rect);

    bool getOverBurdenEnable();
    void setOverBurdenEnable(bool arg);

public Q_SLOTS:

    void on_slider_valueChanged();
    void on_previewMoved(QRect rect);

private:

    QVector<double> m_vecScaleRate;
    int m_nScaleIndex;
};


